<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>旋转木马</title>
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			#content{
				width: 300px;
				height: 300px;
				margin: 200px auto;
				perspective: 800px;
			}
			#box{
				width: 100%;
				height: 100%;
				position: relative;
				transform-style: preserve-3d;
				animation: an 8s linear infinite;
			}
			#box:hover{
				animation-play-state: paused;
		    }
		    @keyframes an{
		    	0%{
		    		transform: rotateY(0deg);
		    	}
		    	10%{
		    		transform: rotateY(40deg);
		    	}
		    	20%{
		    		transform: rotateY(80deg);
		    	}
		    	30%{
		    		transform: rotateY(120deg);
		    	}
		    	40%{
		    		transform: rotateY(160deg);
		    	}
		    	50%{
		    		transform: rotateY(200deg);
		    	}
		    	60%{
		    		transform: rotateY(240deg);
		    	}
		    	70%{
		    		transform: rotateY(280deg);
		    	}
		    	80%{
		    		transform: rotateY(320deg);
		    	}
		    	100%{
		    		transform: rotateY(360deg);
		    	}
		    }
			#box li{
				list-style: none;
				width: 100%;
				height: 100%;
				opacity: 1;
				position: absolute;
			}
			#box li:nth-child(1){
				background: url(1.png) no-repeat center;
				transform: rotateY(0deg) translateZ(300px);
			}
			#box li:nth-child(2){
				background: url(1.png) no-repeat center;
				transform: rotateY(40deg) translateZ(300px);
			}
			#box li:nth-child(3){
				background: url(1.png) no-repeat center;
				transform: rotateY(80deg) translateZ(300px);
			}
			#box li:nth-child(4){
				background: url(1.png) no-repeat center;
				transform: rotateY(120deg) translateZ(300px);
			}
			#box li:nth-child(5){
				background: url(1.png) no-repeat center;
				transform: rotateY(160deg) translateZ(300px);
			}
			#box li:nth-child(6){
				background: url(1.png) no-repeat center;
				transform: rotateY(200deg) translateZ(300px);
			}
			#box li:nth-child(7){
				background: url(1.png) no-repeat center;
				transform: rotateY(240deg) translateZ(300px);
			}
			#box li:nth-child(8){
				background: url(1.png) no-repeat center;
				transform: rotateY(280deg) translateZ(300px);
			}
			#box li:nth-child(9){
				background: url(1.png) no-repeat center;
				transform: rotateY(320deg) translateZ(300px);
			}
		</style>
	</head>
	<body>
		<div id="content">
			<ul id="box">
				<li>1</li>
				<li>2</li>
				<li>3</li>
				<li>4</li>
				<li>5</li>
				<li>6</li>
				<li>7</li>
				<li>8</li>
				<li>9</li>
			</ul>
		</div>
	</body>
</html>
